{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "8bW5uwdFfj5K",
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\SONAL BANSAL\\Anaconda3\\lib\\site-packages\\sklearn\\ensemble\\weight_boosting.py:29: DeprecationWarning: numpy.core.umath_tests is an internal NumPy module and should not be imported. It will be removed in a future NumPy release.\n",
      "  from numpy.core.umath_tests import inner1d\n"
     ]
    }
   ],
   "source": [
    "import random,math,copy,time\n",
    "from sklearn.neighbors import KNeighborsClassifier\n",
    "from sklearn.ensemble import (RandomForestClassifier,GradientBoostingClassifier)\n",
    "from sklearn import tree\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn.model_selection import train_test_split,cross_val_score\n",
    "import matplotlib.pyplot as plt\n",
    "from sklearn import preprocessing, svm\n",
    "from tqdm import tqdm\n",
    "import time\n",
    "from sklearn.model_selection import GridSearchCV"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "m=20  # Problem dimension (number of decision variables\n",
    "Ap=0.1  # Awareness probability\n",
    "fl=2   # Flight length (fl)\n",
    "wf=1.2# wf is used to control the importance of classification accuracy and number of selected features."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "VSQ4rCRjfj5V"
   },
   "outputs": [],
   "source": [
    "df=pd.read_csv(\"AD-CN.csv\")\n",
    "df = df.dropna(how='all')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "yBZV56q2m6-s"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>...</th>\n",
       "      <th>67590</th>\n",
       "      <th>67591</th>\n",
       "      <th>67592</th>\n",
       "      <th>67593</th>\n",
       "      <th>67594</th>\n",
       "      <th>67595</th>\n",
       "      <th>67596</th>\n",
       "      <th>67597</th>\n",
       "      <th>67598</th>\n",
       "      <th>67599</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>55</td>\n",
       "      <td>56</td>\n",
       "      <td>57</td>\n",
       "      <td>57</td>\n",
       "      <td>57</td>\n",
       "      <td>57</td>\n",
       "      <td>56</td>\n",
       "      <td>55</td>\n",
       "      <td>56</td>\n",
       "      <td>...</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>59</td>\n",
       "      <td>60</td>\n",
       "      <td>59</td>\n",
       "      <td>58</td>\n",
       "      <td>57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 67601 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   label    0    1    2    3    4    5    6    7    8  ...    67590  67591  \\\n",
       "0      0   55   56   57   57   57   57   56   55   56  ...       59     59   \n",
       "1      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "2      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "3      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "4      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "\n",
       "   67592  67593  67594  67595  67596  67597  67598  67599  \n",
       "0     59     59     59     59     60     59     58     57  \n",
       "1    255    255    255    255    255    255    255    255  \n",
       "2    255    255    255    255    255    255    255    255  \n",
       "3    255    255    255    255    255    255    255    255  \n",
       "4    255    255    255    255    255    255    255    255  \n",
       "\n",
       "[5 rows x 67601 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# df=df.drop(columns=['Unnamed: 0'])\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 235
    },
    "colab_type": "code",
    "id": "i5qnzPEforlt",
    "outputId": "e49cbf0d-6390-45dd-f8ee-52397198c00f"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 1215 entries, 0 to 1214\n",
      "Columns: 67601 entries, label to 67599\n",
      "dtypes: int64(67601)\n",
      "memory usage: 626.7 MB\n"
     ]
    }
   ],
   "source": [
    "df.info()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "PPwseQsIglXa"
   },
   "outputs": [],
   "source": [
    "val_Data = pd.read_csv(\"AD-CN_val.csv\")\n",
    "val_Data = val_Data.dropna(how='all')\n",
    "#val_Data=val_Data.drop(columns=['Unnamed: 0'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "colab": {
     "base_uri": "https://localhost:8080/",
     "height": 235
    },
    "colab_type": "code",
    "id": "wmWJFkWDgu_7",
    "outputId": "c147cdca-b994-4f9b-8b49-22c8ca7d71e1"
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>label</th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>...</th>\n",
       "      <th>67590</th>\n",
       "      <th>67591</th>\n",
       "      <th>67592</th>\n",
       "      <th>67593</th>\n",
       "      <th>67594</th>\n",
       "      <th>67595</th>\n",
       "      <th>67596</th>\n",
       "      <th>67597</th>\n",
       "      <th>67598</th>\n",
       "      <th>67599</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>254</td>\n",
       "      <td>253</td>\n",
       "      <td>254</td>\n",
       "      <td>...</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "      <td>255</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 67601 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   label    0    1    2    3    4    5    6    7    8  ...    67590  67591  \\\n",
       "0      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "1      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "2      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "3      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "4      0  255  255  255  255  255  255  254  253  254  ...      255    255   \n",
       "\n",
       "   67592  67593  67594  67595  67596  67597  67598  67599  \n",
       "0    255    255    255    255    255    255    255    255  \n",
       "1    255    255    255    255    255    255    255    255  \n",
       "2    255    255    255    255    255    255    255    255  \n",
       "3    255    255    255    255    255    255    255    255  \n",
       "4    255    255    255    255    255    255    255    255  \n",
       "\n",
       "[5 rows x 67601 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "val_Data.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "Int64Index: 316 entries, 0 to 315\n",
      "Columns: 67601 entries, label to 67599\n",
      "dtypes: int64(67601)\n",
      "memory usage: 163.0 MB\n"
     ]
    }
   ],
   "source": [
    "val_Data.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "_W4D-XnDfj5j"
   },
   "outputs": [],
   "source": [
    "features = [i for i in range(0,67600)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "VvAFiZhvfj5n"
   },
   "outputs": [],
   "source": [
    "d=67600# Flock (population) size\n",
    "lt=67600\n",
    "y_train=df['label']\n",
    "x_train=df[df.columns[1:]]\n",
    "x_train.columns=features"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "K-e_XSa4pKr8"
   },
   "outputs": [],
   "source": [
    "y_test = val_Data['label']\n",
    "x_test = val_Data[val_Data.columns[1:]]\n",
    "x_test.columns=features"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## WITHOUT GRID-SEARCH AND WITHOUT BIO-INSPIRED"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "Kgvbr_X7fj51"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1553614112.9530687\n",
      "0.7626582278481012\n",
      "0.7658227848101266\n",
      "0.7468354430379747\n",
      "0.9272151898734177\n"
     ]
    }
   ],
   "source": [
    "print(time.time())\n",
    "\n",
    "neigh1 = KNeighborsClassifier()\n",
    "neigh1.fit(x_train, y_train)\n",
    "neigh1.predict(x_test)\n",
    "nacc1=neigh1.score(x_test,y_test)\n",
    "\n",
    "print(nacc1)\n",
    "\n",
    "#\n",
    "rforest1 = RandomForestClassifier()\n",
    "rforest1.fit(x_train, y_train)\n",
    "rforest1.predict(x_test)\n",
    "rfacc1=rforest1.score(x_test,y_test)\n",
    "\n",
    "print(rfacc1)\n",
    "\n",
    "#\n",
    "dtree1 = tree.DecisionTreeClassifier()\n",
    "dtree1.fit(x_train, y_train)\n",
    "dtree1.predict(x_test)\n",
    "dtacc1=dtree1.score(x_test,y_test)\n",
    "\n",
    "print(dtacc1)\n",
    "\n",
    "clf1 = svm.SVC()\n",
    "clf1.fit(x_train, y_train)\n",
    "clf1.predict(x_test)\n",
    "clfacc1=clf1.score(x_test,y_test)\n",
    "\n",
    "print(clfacc1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0. 0. 0. ... 0. 0. 0.]\n"
     ]
    }
   ],
   "source": [
    "im=(rforest1.feature_importances_)\n",
    "print(im)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "  0%|                                                                                        | 0/67600 [00:00<?, ?it/s]C:\\Users\\SONAL BANSAL\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:3: FutureWarning: set_value is deprecated and will be removed in a future release. Please use .at[] or .iat[] accessors instead\n",
      "  This is separate from the ipykernel package so we can avoid doing imports until\n",
      "100%|███████████████████████████████████████████████████████████████████████████| 67600/67600 [07:20<00:00, 153.40it/s]\n"
     ]
    }
   ],
   "source": [
    "imo=pd.Series()\n",
    "for i in tqdm(range(d)):\n",
    "    imo= imo.set_value(features[i],im[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "67600"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "imo.to_csv('importance_feature_AD-CN.csv')\n",
    "len(imo)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## WITH GRID-SEARCH WITHOUT BIO-INSPIRED"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 324 candidates, totalling 972 fits\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=  12.0s\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:   13.5s remaining:    0.0s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=   4.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=   4.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=  16.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=  20.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=  18.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  25.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  30.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  30.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total=  32.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total=  46.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total=  50.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total=  51.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total= 1.0min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total=  55.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total= 1.0min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total= 1.5min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total= 1.4min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   3.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   3.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   3.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  14.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  19.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  15.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  11.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  33.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  26.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total=  30.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total=  42.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total=  48.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total=  45.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total= 1.0min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total=  53.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total=  42.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total= 1.4min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total= 1.6min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   4.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   4.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   4.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  15.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  20.3s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  18.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  27.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  37.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  35.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  38.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  46.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  45.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400, total=  44.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400, total=  51.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=400, total=  44.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500, total=  49.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=2, min_samples_split=20, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10, total=   3.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10, total=   3.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=10, total=   2.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100, total=   9.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100, total=  14.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=100, total=  15.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200, total=  23.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200, total=  30.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=200, total=  29.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300, total=  31.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300, total=  45.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=300, total=  44.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400, total=  40.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400, total=  49.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=400, total=  56.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500, total=  47.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=5, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10, total=   3.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10, total=   3.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=10, total=   3.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100, total=  12.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100, total=  17.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=100, total=  16.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200, total=  22.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200, total=  31.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=200, total=  29.6s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300, total=  31.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300, total=  37.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=300, total=  41.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400, total=  37.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400, total=  57.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=400, total=  49.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500, total=  59.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500, total= 1.4min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=10, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10, total=   3.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10, total=   3.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=10, total=   3.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100, total=  11.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100, total=  14.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=100, total=  14.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200, total=  19.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200, total=  28.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=200, total=  20.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300, total=  25.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300, total=  39.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=300, total=  40.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400, total=  43.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400, total=  54.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=400, total=  58.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500, total=  56.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=4, min_samples_split=20, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10, total=   3.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10, total=   3.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=10, total=   3.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100, total=  11.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100, total=  15.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=100, total=  15.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200, total=  21.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200, total=  30.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=200, total=  30.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300, total=  28.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300, total=  42.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=300, total=  40.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400, total=  41.8s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400, total=  58.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=400, total=  55.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500, total=  53.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=5, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10, total=   3.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10, total=   3.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=10, total=   3.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100, total=  10.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100, total=  15.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=100, total=  10.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200, total=  20.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200, total=  29.6s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=200, total=  26.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300, total=  24.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300, total=  34.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=300, total=  46.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400, total=  43.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400, total=  57.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=400, total=  55.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500, total=  45.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=10, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10, total=   3.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10, total=   3.4s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=10, total=   2.9s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100, total=  11.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100, total=  15.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=100, total=  16.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200, total=  20.8s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200, total=  27.7s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=200, total=  23.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300, total=  32.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300, total=  46.3s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=300, total=  44.0s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400, total=  44.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400, total=  51.1s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=400, total=  56.2s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500, total=  40.5s\n",
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500, total=  46.4s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=10, min_samples_leaf=6, min_samples_split=20, n_estimators=500, total=  51.2s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=   3.4s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=   3.0s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=10, total=   3.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=   9.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=  11.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=100, total=  12.3s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  18.8s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  29.3s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=200, total=  35.5s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total=  39.1s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total= 1.0min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=300, total=  50.6s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total=  31.1s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total= 1.2min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=400, total= 1.3min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total= 1.4min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=5, n_estimators=500, total=  58.0s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   4.2s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   2.5s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=10, total=   2.6s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  12.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  10.2s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=100, total=  11.5s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  16.6s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  33.0s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=200, total=  32.8s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total=  37.2s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total=  47.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=300, total= 1.0min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total=  45.5s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total=  43.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=400, total= 1.1min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total=  38.2s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total= 1.6min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=10, n_estimators=500, total= 1.6min\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   1.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   1.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=10, total=   1.8s\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  10.4s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  21.4s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=100, total=  16.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  22.9s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  33.0s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=200, total=  41.9s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  21.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  49.9s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=300, total=  35.7s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=400, total=  39.0s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n",
      "[CV]  criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=400, total=  56.4s\n",
      "[CV] criterion=gini, max_depth=20, min_samples_leaf=2, min_samples_split=20, n_estimators=400 \n"
     ]
    }
   ],
   "source": [
    "rfparams = {'n_estimators':[10,100,200,300,400,500], 'criterion':['gini','entropy'], 'max_depth':[10,20,30], 'min_samples_split':[5,10,20], 'min_samples_leaf':[2,4,6]}\n",
    "grid_rf = GridSearchCV(rforest1, rfparams, verbose=2)\n",
    "grid_rf.fit(x_train, y_train)\n",
    "grid_rf.predict(x_test)\n",
    "print(grid_rf.best_score_)\n",
    "print(grid_rf.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dtparams = {'criterion':['gini', 'entropy'], 'splitter':['best','random'], 'max_depth':[10,20,30], 'min_samples_split':[5,10,20], 'min_samples_leaf':[2,4,6]}\n",
    "grid_dt = GridSearchCV(dtree1, dtparams, verbose=2)\n",
    "grid_dt.fit(x_train, y_train)\n",
    "grid_dt.predict(x_test)\n",
    "print(grid_dt.best_score_)\n",
    "print(grid_dt.best_params_)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "svcparams = {'C':[1.0,10,100,1000], 'kernel':['rbf','linear', 'poly', 'sigmoid'], 'degree':[3,4,5], 'gamma':['auto',0.1,0.01,0.001]}\n",
    "grid_svc = GridSearchCV(clf1, svcparams, verbose=2)\n",
    "grid_svc.fit(x_train, y_train)\n",
    "grid_svc.predict(x_test)\n",
    "print(grid_svc.best_score_)\n",
    "print(grid_svc.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "knnparams = {'algorithm':['auto', 'ball_tree', 'kd_tree', 'brute'], 'n_neighbors':[3, 4, 5, 6, 7], 'leaf_size':[10, 20, 30, 40], 'p':[1, 2, 3]}\n",
    "grid_knn = GridSearchCV(neigh1, knnparams, verbose=2)\n",
    "grid_knn.fit(x_train, y_train)\n",
    "grid_knn.predict(x_test)\n",
    "print(grid_knn.best_score_)\n",
    "print(grid_knn.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "JSz_SiuQfj6S"
   },
   "outputs": [],
   "source": [
    "def init():   #initialization function\n",
    "    df2=pd.DataFrame(np.ones((m,d),dtype='int'),columns=features)\n",
    "    return df2\n",
    "#df2=init()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## FITNESS FUNCTION"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "ylLmuEVjfj6X"
   },
   "outputs": [],
   "source": [
    "# this defines the fitness of each crow by calculating their accuracy and no features selected using the below formula\n",
    "def fitness(df2):      # fitness function whose 1 parameter takes the crows and their position as input\n",
    "    fnt=np.zeros((m,1))  # fnt is the fitness function\n",
    "    for k in tqdm(range(m)):    \n",
    "        global sel\n",
    "        sel=[]\n",
    "        q=0\n",
    "        imp=0\n",
    "        a=(df2.iloc[k,:])==0.0\n",
    "        if a.all()==True:\n",
    "            df2.iloc[k,:]=1.0\n",
    "        for p in list(features):\n",
    "            if df2.loc[k,p]==1.0:\n",
    "                sel.insert(q,p)\n",
    "                temp=imo[p]\n",
    "                imp=imp+temp\n",
    "            q=q+1\n",
    "        lf=len(sel)\n",
    "        divide=lf/lt\n",
    "        fnt[k]=imp+wf*(1-float(lf/lt))     # fitness formula\n",
    "    return fnt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "3JX1sTSufj6c"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [01:39<00:00,  4.98s/it]\n"
     ]
    }
   ],
   "source": [
    "z=init()   #crow memory with initial position\n",
    "tmax=50   # Maximum number of iterations (itermax)\n",
    "xn=z.copy()  # the position of the crow\n",
    "mem=init()  # memory is initialized using the init function\n",
    "xnew=(xn).copy()   # the positions of the crow\n",
    "ft=fitness(xn)\n",
    "plotit=[]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## FEATURES IMPORTANCE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "cRGlsQ57fj6j",
    "outputId": "ecb5e6e9-c09c-4581-d79f-55308fae3400"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "  0%|                                                                                           | 0/20 [00:00<?, ?it/s]\n",
      " 30%|████████████████████████▉                                                          | 6/20 [00:00<00:00, 50.98it/s]\n",
      " 50%|█████████████████████████████████████████                                         | 10/20 [00:00<00:00, 46.42it/s]\n",
      " 65%|█████████████████████████████████████████████████████▎                            | 13/20 [00:00<00:00, 35.61it/s]\n",
      " 80%|█████████████████████████████████████████████████████████████████▌                | 16/20 [00:00<00:00, 29.33it/s]\n",
      "100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:00<00:00, 32.50it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "transpose\n",
      "exp\n"
     ]
    },
    {
     "ename": "KeyboardInterrupt",
     "evalue": "",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-22-5de285cf69b5>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m     26\u001b[0m     \u001b[0mxnew\u001b[0m\u001b[1;33m=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;36m1\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexpm1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;36m10\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m0.5\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m    \u001b[1;31m#  formula to convert positions of each crow into 0 and 1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     27\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'exp'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 28\u001b[1;33m     \u001b[0mxnew\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mlambda\u001b[0m \u001b[0ml\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0ml\u001b[0m\u001b[1;33m>=\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     29\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'apply lambda'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     30\u001b[0m     \u001b[0mxn\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\frame.py\u001b[0m in \u001b[0;36mapply\u001b[1;34m(self, func, axis, broadcast, raw, reduce, result_type, args, **kwds)\u001b[0m\n\u001b[0;32m   6012\u001b[0m                          \u001b[0margs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0margs\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   6013\u001b[0m                          kwds=kwds)\n\u001b[1;32m-> 6014\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0mop\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_result\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   6015\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   6016\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mapplymap\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\apply.py\u001b[0m in \u001b[0;36mget_result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    316\u001b[0m                                       *self.args, **self.kwds)\n\u001b[0;32m    317\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 318\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0msuper\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mFrameRowApply\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget_result\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    319\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    320\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mapply_broadcast\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\apply.py\u001b[0m in \u001b[0;36mget_result\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    140\u001b[0m             \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply_raw\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    141\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 142\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply_standard\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    143\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    144\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mapply_empty_result\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\apply.py\u001b[0m in \u001b[0;36mapply_standard\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    246\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    247\u001b[0m         \u001b[1;31m# compute the result using the series generator\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 248\u001b[1;33m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply_series_generator\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    249\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    250\u001b[0m         \u001b[1;31m# wrap results\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\apply.py\u001b[0m in \u001b[0;36mapply_series_generator\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m    275\u001b[0m             \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    276\u001b[0m                 \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mv\u001b[0m \u001b[1;32min\u001b[0m \u001b[0menumerate\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mseries_gen\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 277\u001b[1;33m                     \u001b[0mresults\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mf\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mv\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    278\u001b[0m                     \u001b[0mkeys\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mv\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    279\u001b[0m             \u001b[1;32mexcept\u001b[0m \u001b[0mException\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m<ipython-input-22-5de285cf69b5>\u001b[0m in \u001b[0;36m<lambda>\u001b[1;34m(l)\u001b[0m\n\u001b[0;32m     26\u001b[0m     \u001b[0mxnew\u001b[0m\u001b[1;33m=\u001b[0m \u001b[1;36m1\u001b[0m\u001b[1;33m/\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;36m1\u001b[0m \u001b[1;33m+\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexpm1\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m \u001b[1;36m10\u001b[0m\u001b[1;33m*\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m0.5\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m    \u001b[1;31m#  formula to convert positions of each crow into 0 and 1\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     27\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'exp'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 28\u001b[1;33m     \u001b[0mxnew\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mapply\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;32mlambda\u001b[0m \u001b[0ml\u001b[0m\u001b[1;33m:\u001b[0m\u001b[0ml\u001b[0m\u001b[1;33m>=\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mrandom\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mastype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mint\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     29\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'apply lambda'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     30\u001b[0m     \u001b[0mxn\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mxnew\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\ops.py\u001b[0m in \u001b[0;36mwrapper\u001b[1;34m(self, other, axis)\u001b[0m\n\u001b[0;32m   1289\u001b[0m             \u001b[0mres_values\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcom\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_values_from_object\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mres\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1290\u001b[0m             return self._constructor(res_values, index=self.index,\n\u001b[1;32m-> 1291\u001b[1;33m                                      name=res_name, dtype='bool')\n\u001b[0m\u001b[0;32m   1292\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   1293\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mwrapper\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\series.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, data, index, dtype, name, copy, fastpath)\u001b[0m\n\u001b[0;32m    275\u001b[0m                                        raise_cast_failure=True)\n\u001b[0;32m    276\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 277\u001b[1;33m                 \u001b[0mdata\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mSingleBlockManager\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mindex\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfastpath\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    278\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    279\u001b[0m         \u001b[0mgeneric\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mNDFrame\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdata\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mfastpath\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mTrue\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36m__init__\u001b[1;34m(self, block, axis, do_integrity_check, fastpath)\u001b[0m\n\u001b[0;32m   4675\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4676\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mblock\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mBlock\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 4677\u001b[1;33m             \u001b[0mblock\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mmake_block\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mblock\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mplacement\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mslice\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mndim\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   4678\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   4679\u001b[0m         \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mblocks\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m[\u001b[0m\u001b[0mblock\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mmake_block\u001b[1;34m(values, placement, klass, ndim, dtype, fastpath)\u001b[0m\n\u001b[0;32m   3197\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0mklass\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3198\u001b[0m         \u001b[0mdtype\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdtype\u001b[0m \u001b[1;32mor\u001b[0m \u001b[0mvalues\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mdtype\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3199\u001b[1;33m         \u001b[0mklass\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mget_block_type\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   3200\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3201\u001b[0m     \u001b[1;32melif\u001b[0m \u001b[0mklass\u001b[0m \u001b[1;32mis\u001b[0m \u001b[0mDatetimeTZBlock\u001b[0m \u001b[1;32mand\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mis_datetimetz\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\internals.py\u001b[0m in \u001b[0;36mget_block_type\u001b[1;34m(values, dtype)\u001b[0m\n\u001b[0;32m   3174\u001b[0m         \u001b[1;32massert\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0mis_datetimetz\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3175\u001b[0m         \u001b[0mcls\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mDatetimeBlock\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m-> 3176\u001b[1;33m     \u001b[1;32melif\u001b[0m \u001b[0mis_datetimetz\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvalues\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m   3177\u001b[0m         \u001b[0mcls\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mDatetimeTZBlock\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m   3178\u001b[0m     \u001b[1;32melif\u001b[0m \u001b[0missubclass\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mvtype\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0minteger\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\dtypes\\common.py\u001b[0m in \u001b[0;36mis_datetimetz\u001b[1;34m(arr)\u001b[0m\n\u001b[0;32m    268\u001b[0m     return ((isinstance(arr, ABCDatetimeIndex) and\n\u001b[0;32m    269\u001b[0m              getattr(arr, 'tz', None) is not None) or\n\u001b[1;32m--> 270\u001b[1;33m             is_datetime64tz_dtype(arr))\n\u001b[0m\u001b[0;32m    271\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    272\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\Anaconda3\\lib\\site-packages\\pandas\\core\\dtypes\\common.py\u001b[0m in \u001b[0;36mis_datetime64tz_dtype\u001b[1;34m(arr_or_dtype)\u001b[0m\n\u001b[0;32m    402\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0marr_or_dtype\u001b[0m \u001b[1;32mis\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    403\u001b[0m         \u001b[1;32mreturn\u001b[0m \u001b[1;32mFalse\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 404\u001b[1;33m     \u001b[1;32mreturn\u001b[0m \u001b[0mDatetimeTZDtype\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mis_dtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marr_or_dtype\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    405\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    406\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mKeyboardInterrupt\u001b[0m: "
     ]
    }
   ],
   "source": [
    "tottime=0\n",
    "# it is a formula to convert positions of each crow into 0 and 1 \n",
    "for t in range(tmax):\n",
    "    print(t)# no of iterations\n",
    "    time1=time.time()\n",
    "   \n",
    "    xnew_list = []\n",
    "    plotit.append(ft.max())\n",
    "    num = random.randint(0,m-1)  \n",
    "   # Generation of random candidate crows for following (chasing)\n",
    "    for i in tqdm(range(m)):   \n",
    "       \n",
    "        r=random.random()\n",
    "        if r>=Ap:\n",
    "            \n",
    "            xnew_list.append((xn.loc[i,:]+fl*r*(mem.loc[num,:]-xn.loc[i,:])).tolist())# Generation of a new position for crow i (state 1)\n",
    "            \n",
    "        else:\n",
    "            \n",
    "            xnew_list.append((xnew.loc[i,:].apply(lambda lam:random.random())).tolist())   # Generation of a new position for crow i (state 2)\n",
    "            \n",
    "            \n",
    "    xnew = pd.DataFrame(xnew_list)\n",
    "    del xnew_list\n",
    "    print('transpose')\n",
    "    xnew= 1/( 1 + np.expm1(( 10*(xnew-0.5))))    #  formula to convert positions of each crow into 0 and 1\n",
    "    print('exp')\n",
    "    xnew=xnew.apply(lambda l:l>=random.random()).astype(int)\n",
    "    print('apply lambda')\n",
    "    xn=xnew.copy()     \n",
    "    print('copied')\n",
    "    # it is the updated binary position of each crow\n",
    "    #feasibility test\n",
    "    # this is done so that to check if atleast one position of the crow has value equal to 1. if it is not true then every\n",
    "    # position value of the crow is made 1.\n",
    "    for i in tqdm(range(m)):\n",
    "        \n",
    "        if ((xn.loc[i,:])==0.0).all()==True:\n",
    "            xn.loc[i,:]=1.0\n",
    "    \n",
    "    print('running fitness')\n",
    "    ft_new=fitness(xn).reshape(ft.shape)# here the accuracy of each crows are calculated.\n",
    "\n",
    "    print('fitness done')\n",
    "    for i in tqdm(range(m)):\n",
    "         \n",
    "        if ft_new[i]>ft[i]:\n",
    "            ft[i]=ft_new[i]\n",
    "            for j in features:\n",
    "                mem.loc[i,j]= xn.loc[i,j]\n",
    "    \n",
    "    print('complete'+str(t))\n",
    "    time2=time.time()\n",
    "    tottime=tottime+(time2-time1)\n",
    "print(tottime/t+1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## WITHOUT GRID SEARCH , WITH BIO-INSPIRED"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "UWaVv43_fj6r",
    "outputId": "4f74a579-a407-46f5-da84-45edd05a6d62"
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "  0%|                                                                                           | 0/20 [00:00<?, ?it/s]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0\n",
      "[0.73101266]\n",
      "[0.78164557]\n",
      "[0.76582278]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "  5%|████▏                                                                              | 1/20 [00:20<06:35, 20.80s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "[0.73101266]\n",
      "[0.73734177]\n",
      "[0.77531646]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 10%|████████▎                                                                          | 2/20 [00:31<04:45, 15.85s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "[0.73101266]\n",
      "[0.73734177]\n",
      "[0.76898734]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 15%|████████████▍                                                                      | 3/20 [00:42<04:02, 14.25s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n",
      "[0.75632911]\n",
      "[0.73734177]\n",
      "[0.73734177]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 20%|████████████████▍                                                                 | 4/20 [07:57<31:49, 119.31s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "4\n",
      "[0.73101266]\n",
      "[0.75949367]\n",
      "[0.76898734]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 25%|████████████████████▊                                                              | 5/20 [08:08<24:25, 97.71s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "[0.73101266]\n",
      "[0.74050633]\n",
      "[0.76582278]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 30%|████████████████████████▉                                                          | 6/20 [08:19<19:25, 83.27s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6\n",
      "[0.75949367]\n",
      "[0.75316456]\n",
      "[0.75316456]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 35%|████████████████████████████▋                                                     | 7/20 [16:24<30:27, 140.58s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7\n",
      "[0.73101266]\n",
      "[0.75949367]\n",
      "[0.76898734]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 40%|████████████████████████████████▊                                                 | 8/20 [16:36<24:54, 124.57s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8\n",
      "[0.73101266]\n",
      "[0.7056962]\n",
      "[0.78481013]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 45%|████████████████████████████████████▉                                             | 9/20 [16:46<20:30, 111.88s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9\n",
      "[0.74050633]\n",
      "[0.79113924]\n",
      "[0.77848101]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 50%|████████████████████████████████████████▌                                        | 10/20 [25:22<25:22, 152.27s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "10\n",
      "[0.73101266]\n",
      "[0.78164557]\n",
      "[0.75949367]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 55%|████████████████████████████████████████████▌                                    | 11/20 [25:34<20:55, 139.51s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11\n",
      "[0.73101266]\n",
      "[0.72468354]\n",
      "[0.77848101]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 60%|████████████████████████████████████████████████▌                                | 12/20 [25:45<17:10, 128.79s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "12\n",
      "[0.73101266]\n",
      "[0.71202532]\n",
      "[0.78164557]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 65%|████████████████████████████████████████████████████▋                            | 13/20 [25:55<13:57, 119.64s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "13\n",
      "[0.73101266]\n",
      "[0.74050633]\n",
      "[0.7721519]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 70%|████████████████████████████████████████████████████████▋                        | 14/20 [26:04<11:10, 111.78s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "14\n",
      "[0.73101266]\n",
      "[0.76898734]\n",
      "[0.76898734]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 75%|████████████████████████████████████████████████████████████▊                    | 15/20 [26:14<08:44, 105.00s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "15\n",
      "[0.73101266]\n",
      "[0.7721519]\n",
      "[0.77848101]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 80%|█████████████████████████████████████████████████████████████████▌                | 16/20 [26:24<06:36, 99.02s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "16\n",
      "[0.73101266]\n",
      "[0.76265823]\n",
      "[0.76582278]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 85%|█████████████████████████████████████████████████████████████████████▋            | 17/20 [26:34<04:41, 93.77s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "17\n",
      "[0.73101266]\n",
      "[0.76582278]\n",
      "[0.78797468]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 90%|█████████████████████████████████████████████████████████████████████████▊        | 18/20 [26:43<02:58, 89.10s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "18\n",
      "[0.75632911]\n",
      "[0.75316456]\n",
      "[0.79746835]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      " 95%|████████████████████████████████████████████████████████████████████████████▉    | 19/20 [37:49<01:59, 119.44s/it]"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "19\n",
      "[0.73101266]\n",
      "[0.76582278]\n",
      "[0.76582278]\n",
      "[0.92721519]\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n",
      "100%|█████████████████████████████████████████████████████████████████████████████████| 20/20 [38:00<00:00, 114.01s/it]\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.759493670886076 0.7911392405063291 0.7974683544303798 0.9272151898734177\n"
     ]
    }
   ],
   "source": [
    "# here the accuracy of each crows are calculated.\n",
    "neigh2 = KNeighborsClassifier()\n",
    "rforest2 =RandomForestClassifier()\n",
    "dtree2 = tree.DecisionTreeClassifier()\n",
    "clf2 = svm.SVC()\n",
    "\n",
    "nacc2=np.zeros((m,1),dtype='float64')\n",
    "rfacc2=np.zeros((m,1),dtype='float64')\n",
    "dtacc2=np.zeros((m,1),dtype='float64')\n",
    "clfacc2=np.zeros((m,1),dtype='float64')\n",
    "\n",
    "q=0\n",
    "for i in tqdm(range(m)):\n",
    "    print(i)\n",
    "    select=[]\n",
    "    for p in list(features):\n",
    "        if mem.loc[i,p]==1:\n",
    "            select.insert(q,p)\n",
    "            q=q+1\n",
    "    neigh2.fit(x_train[select], y_train)\n",
    "    neigh2.predict(x_test[select])\n",
    "    nacc2[i]=neigh2.score(x_test[select],y_test) \n",
    "    print(nacc2[i])\n",
    "    \n",
    "    rforest2.fit(x_train[select], y_train)\n",
    "    rforest2.predict(x_test[select])\n",
    "    rfacc2[i]=rforest2.score(x_test[select],y_test) \n",
    "    print(rfacc2[i])\n",
    "    \n",
    "    dtree2.fit(x_train[select], y_train)\n",
    "    dtree2.predict(x_test[select])\n",
    "    dtacc2[i]=dtree2.score(x_test[select],y_test)\n",
    "    print(dtacc2[i])\n",
    "    \n",
    "    clf2.fit(x_train[select], y_train)\n",
    "    clf2.predict(x_test[select])\n",
    "    clfacc2[i]=clf2.score(x_test[select],y_test)\n",
    "    print(clfacc2[i])\n",
    "\n",
    "print (nacc2.max(), rfacc2.max(), dtacc2.max(),clfacc2.max()) # the crow with maximum accuracy is printed"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**SELECTED FEATURED**"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "pAMS1eJkfj6_",
    "outputId": "f05d8b75-894c-480c-9657-c461161a125b"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "449\n",
      "449\n",
      "449\n",
      "449\n"
     ]
    }
   ],
   "source": [
    "print ((mem.loc[nacc1.argmax(),:]==1.0).sum())\n",
    "\n",
    "print ((mem.loc[rfacc1.argmax(),:]==1.0).sum())\n",
    "print ((mem.loc[dtacc1.argmax(),:]==1.0).sum())\n",
    "print ((mem.loc[clfacc1.argmax(),:]==1.0).sum())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "60Wb6XQdfj7f",
    "outputId": "b4b9005b-50bb-4719-d94f-deb161810469"
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.9999999999999996, 1.1951512994668654, 1.1951512994668654, 1.1951512994668654]\n"
     ]
    }
   ],
   "source": [
    "plotse=pd.Series(plotit)\n",
    "print(plotit)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "colab": {},
    "colab_type": "code",
    "id": "wp1Gtqy1fj7p",
    "outputId": "d23b913e-5000-4872-dbf8-807683a8e2d4"
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEKCAYAAAA4t9PUAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUHXWd9/H3J0knIfvWJCEL2TpgVAixiWxCMAQBR0FGEVRAZCaOwxbAOcPMmRFn5jnncXyACKJglEzCqCCOoAyDShKWsEuDrGI6nZCQvTsJZCVLd3+fP24F77S93E73vXVv5/M6556u+/tV1f1UKulvflV1qxQRmJmZHaxuaQcwM7PS5kJiZmYd4kJiZmYd4kJiZmYd4kJiZmYd4kJiZmYd4kJiZmYd4kJiZmYd4kJiZmYd0iPtAIUwbNiwGDduXNoxzMxKyosvvrg5Isrbmu+QKCTjxo2j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bwkWSeb5E5HNUe84DfSHosIuqALwP3JOt7lpZ/ef8zmSf3Pc3/vj34vcDfJSfH3z/JHxF7yNzd9efJ4bBG4M42ss2R9HqSZT+Z53ub5cR3/zUzsw7xiMTMzDrEhcTMzDrEhcTMzDrEhcTMzDrEhcTMzDrEhcTMzDrEhcTMzDrEhcTMzDrk/wOm1uzX9fmPmQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x19a1618c358>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(plotse)\n",
    "plt.xlabel('No of iterations')\n",
    "plt.ylabel('Fitness value')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "mem.to_csv('memory_AD-CN.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "colab": {
   "collapsed_sections": [],
   "name": "myccsa.ipynb",
   "provenance": [],
   "version": "0.3.2"
  },
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
